package com.hankol.newretail.bean

import android.annotation.SuppressLint
import com.baselibrary.Constants
import com.baselibrary.base.BasicBean
import com.baselibrary.bean.SeckillActProductBean
import com.baselibrary.extension.checkNotNull
import com.chad.library.adapter.base.entity.MultiItemEntity
import com.hankol.newretail.bean.goods_details.MallProductGiftCommodityVo
import kotlinx.android.parcel.Parcelize

//确认订单- 商品列表
@SuppressLint("ParcelCreator")
@Parcelize
data class ConfrimOrderGoodListBean(val wineryName: String, val products: List<GoodListBean>) :
    BasicBean(), MultiItemEntity {
    override fun getItemType(): Int {
        val imgList = products
        if (imgList != null && imgList.size > 1) {
            return Constants.TYPE_CONFIRM_ORDER_GOOD_MORE
        } else {
            return Constants.TYPE_CONFIRM_ORDER_GOOD_SINGLE
        }
    }
}


//我的订单
@SuppressLint("ParcelCreator")
@Parcelize
data class MyOrderBean(
    val code: String,
    val consumeScore: Int,
    val ctime: Long,
    val desc: String,
    val overtime: Long,
    val payPrice: Int,
    val payTime: Int,
    val payType: Int,
    //提货方式，0-邮寄，1-线下机构提货
    val postOption: Int,
    //0 未评价  1 已评价
    val isComment: Int,
    val postagePrice: Int,
    val price: Long,
    val productOrderId: Long,
    val products: List<GoodListBean>,
    //售后扣除消费奖励积分
    val rewardScore: Int,
    val scoreDeductPrice: Int,
    val shouldPayPrice: Int,
    //状态：0-待付款（创建），1-待发货（已付款），2-待收货（已发货），3-待评价（已收货），4-售后单，5-已完成，6-已关闭
    var status: Int,
    //金麟瓶业务秒杀活动id
    val goldenScaleSeckillActivityId: Long,
    //金麟瓶业务秒杀活动页面地址
    val goldenScaleSeckillActivityHtmlUrl: String,
    val discountOrderId: Long
) : BasicBean()

/*确认订单-->订单详情*/
@SuppressLint("ParcelCreator")
@Parcelize
data class OrderDetailBean(
    //店铺
    val mallOrderShopDtoList: List<MallOrderShopDtoBean>,
    //商品总数
    val numSum: Int,
    //邮费
    val postage: Int,
    //商品总价格/订单总额
    val priceSum: Int,
    //酒币信息
    val scoreInfo: ScoreInfoBean,
    //是否允许提交订单：0否，1是
    val allowSubmit: Int,
    //秒杀对象
    val seckillActProductDTO: SeckillActProductBean
) : BasicBean()

/* 订单详情*/
@SuppressLint("ParcelCreator")
@Parcelize
data class OrderLoadDetailBean(
    val cancelTime: Long,
    val cancelType: Int,
    val orderCancelReason: CancelReasonListBean,
    val code: String,
    val consumeScore: Int,
    val ctime: Long,
    val desc: String,
    val express: ExpressBean,
    //是否允许修改订单地址, 0-不允许,1-允许
    var isAllowModifyAddress: Int,
    val isFans: Int,
    val overtime: Long,
    val payPrice: Int,
    val payTime: Long,
    val payType: Int,
    val poId: Int,
    val postOption: Int,
    val postagePrice: Int,
    val price: Int,
    val productCount: Int,
    val receiveOvertime: Long,
    val receiveTime: Long,
    val rewardScore: Int,
    val scoreDeductPrice: Int,
    val sendTime: Long,
    val shopDto: List<MallOrderShopDtoBean>,
    val shouldPayPrice: Int,
    val shouldRewardScore: Int,
    //状态：0-待付款（创建），1-待发货（已付款），2-待收货（已发货），3-待评价（已收货），5-已完成，6-已关闭
    val status: Int,
    val uid: Int
) : BasicBean()

//店铺
@SuppressLint("ParcelCreator")
@Parcelize
data class MallOrderShopDtoBean(
    val hasScoreGoods: Int,
    val mallOrderSkuDtoList: List<MallOrderSkuDtoBean>,
    val notSupportSkuDtoList: List<NoSupportSkuDtoBean>,
    val numSum: Int,
    val priceSum: Int,
    val shopId: Int,
    val shopName: String,
    val wineryId: String,
    val dealerCode: String,
    var remarkStr: String//本地变量
) : BasicBean(), MultiItemEntity {
    override fun getItemType(): Int {
        val goodsList = mallOrderSkuDtoList
        if (goodsList.checkNotNull() && goodsList.size > 1) {
            return Constants.TYPE_CONFIRM_ORDER_GOOD_MORE
        } else {
            return Constants.TYPE_CONFIRM_ORDER_GOOD_SINGLE
        }
    }
}
data class RemarkBean(
    val shopId: Int,
    val desc: String
)
@SuppressLint("ParcelCreator")
@Parcelize
data class ScoreInfoBean(
    val consumeRate: ConsumeRateBean,
    val consumeScore: Int,
    val myScore: Int,
    val leastScore: Int,
    val scoreDeductPrice: Int,
    //是否可使用酒币:0可用，1不可用，2不够
    val scoreStatus: Int
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class MallOrderSkuDtoBean(
    val isFans: Int,
    var num: Int,
    val postOption: Int,
    val requestNum:Int,
    val price: Long,
    //允许酒币支付：0否，1是
    val scorePayPower: Int,
    val shopId: Int,
    val shopName: String,
    val cname: String,
    val skuCover: String,
    val skuId: Long,
    val popiId: Long,
    val specList: List<String>,
    val spuId: Long,
    val afterSale: AfterSaleBean? = null,
    val spuName: String?=null,
    val giftType:Int = 0,
    var mallProductGiftCommodityVos: List<MallProductGiftCommodityVo>? = emptyList()
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class AfterSaleBean(
    val id: Long, val poId: Long,
//        售后分类：0-普通售后，1-付款订单被取消（用户），2-付款订单被取消（机构）非用户填写，后台判断所得
    val afterSaleCategory: Int,
    //售后申请原因：1-大小/重量与商品描述不符，2-生产日期/保质期与商品描述不符，3-标签/批次/包装成分等与商品描述不符，4-商品变质/发霉/有异物,5-其他
    val afterSaleReason: Int,
    //售后扣除消费奖励积分
    val afterSaleDeductRewardScore: Long, val afterSaleDeductRealRewardScore: Long,
    //酒币账户中余额不足抵扣在退款金额中扣除等值金额
    val scoreNoEnoughDeductPrice: Long,
    //售后被拒绝描述
    val afterSaleRefuseDesc: String,
    //售后申请描述
    val afterSaleDesc: String, val afterSaleRequestTime: Long,
    //售后退款金额
    val afterSaleRealReturnPrice: Long,
    //售后退还积分
    val afterSaleReturnScore: Long,
    //售后申请图片(凭证)
    val afterSalePic: List<String>? = emptyList(),
    //售后状态： 0-处理中，1-同意售后，2-驳回售后
    var afterSaleStatus: Int,
    //售后类型：0-退款
    val afterSaleType: Int
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class ConsumeRateBean(
    val rmb: Int, val score: Int
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class CommitOrderBean(
    val overtime: Long,
    //支付类型：0-现金支付，1-纯酒币支付
    val payType: Int, val poids: String, val shouldPayPrice: Int
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class CreateScoreOrderBean(
    val payPriceSum: Int,
    val poids: String,
    val scoreDeductPriceSum: Int,
    val shouldRewardScore: Int
) : BasicBean()

//物流信息
@SuppressLint("ParcelCreator")
@Parcelize
data class LogisticeInfoBean(
    val kuaiDiInfos: List<KuaiDiInfoBean>, val wuliu: List<WuliuBean>
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class KuaiDiInfoBean(
    val kuaiDiCom: String, val kuaiDiNum: String
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class WuliuBean(
    val com: String,
    val condition: String,
    val `data`: List<WuliuDataBean>,
    val ischeck: String,
    val message: String,
    val nu: String,
    val state: String,
    val status: String
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class WuliuDataBean(
    val areaCode: String,
    val areaName: String,
    val context: String,
    val ftime: String,
    val status: String,
    val time: String
) : BasicBean()

@SuppressLint("ParcelCreator")
@Parcelize
data class CancelReasonListBean(
    val cancellationId: Int, val desc: String, var isSelect: Boolean
) : BasicBean()
@Parcelize
data class OverTimeReceiveBean(
    val success: Boolean
) : BasicBean()
@Parcelize
data class NoSupportSkuDtoBean(
    val buyPolicyText: String,
    val num: Int,
    val price: Long,
    val shopId: Int,
    val shopName: String,
    val skuCover: String,
    val skuId: Int,
    val specList: List<String>,
    val spuId: Int,
    val spuName: String,
    var mallProductGiftCommodityVos: ArrayList<MallProductGiftCommodityVo> = ArrayList()
) : BasicBean()